package com.runmi.webchat.aftersale.dbcore.dao;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.runmi.webchat.aftersale.dbcore.entity.ShopInfo;
import com.runmi.webchat.aftersale.dbcore.mapper.ShopInfoMapper;

@Repository
public class ShopInfoDao {

	@Autowired
	private ShopInfoMapper shopInfoMapper;
	
	public List<ShopInfo> getAllShopInfoList(){
		ShopInfo record=new ShopInfo();
		record.setDelFlag((byte)0);
		record.setStatus((byte)1);
		return shopInfoMapper.select(record);
	}
	
	public ShopInfo getShopInfoByCode(String shopCode){
		ShopInfo record=new ShopInfo();
		record.setDelFlag((byte)0);
		record.setStatus((byte)1);
		record.setShopCode(shopCode);
		List<ShopInfo> shopInfos= shopInfoMapper.select(record);
		if(null!=shopInfos && shopInfos.size()>0){
			return shopInfos.get(0);
		}else{
			return null;
		}
	}
}
